From fed6e4e7f45bd285e4e74ca233a763032267bcb3 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 3 Jul 2003 21:07:35 +0000 Subject: [PATCH] Add snlen and supporesswhite to gpx output options. --- gpx.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gpx.c b/gpx.c index c46b67097..be421e994 100644 --- a/gpx.c +++ b/gpx.c @@ -66,6 +66,8 @@ static void *mkshort_handle; static time_t file_time; static char *gsshortnames = NULL; +static char *snlen = NULL; +static char *suppresswhite = NULL; static char *urlbase = NULL; static route_head *trk_head; static route_head *rte_head; @@ -901,7 +903,7 @@ gpx_waypt_pr(const waypoint *waypointp) { char *tmp_ent; const char *oname = global_opts.synthesize_shortnames ? - mkshort(mkshort_handle, waypointp->description) : + mkshort(mkshort_handle, waypointp->notes) : waypointp->shortname; fprintf(ofd, "\n", @@ -1087,9 +1089,20 @@ void gpx_write(void) { time_t now = 0; + int short_length; time( &now ); - setshort_length(mkshort_handle, 32); + + if (snlen) + short_length = atoi(snlen); + else + short_length = 32; + + if (suppresswhite) { + setshort_whitespace_ok(mkshort_handle, 0); + } + + setshort_length(mkshort_handle, short_length); fprintf(ofd, "\n"); fprintf(ofd, "